import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/home/index.vue'
import Table from '@/components/Table.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    components: {
      default:HomeView,
      footer:Table
    }
  },
  {
    path: '/kind',
    name: 'kind',
    components: {
      default:() => import('../views/kind/index.vue'),
      footer:Table
    }
  },
  {
    path: '/cart',
    name: 'cart',
    components: {
      default:() => import('../views/cart/index.vue'),
      footer:Table
    }
  },
  {
    path: '/my',
    name: 'my',
    components: {
      default:() => import('../views/my/index.vue'),
      footer:Table
    }
  },
  {
    path: '/detail/:id',
    name: 'detail',
    components: {
      default:() => import('../views/detail/index.vue'),
    }
  },
  {
    path: '/login',
    name: 'login',
    components: {
      default:() => import('../views/login/index.vue'),
    }
  },
  {
    path: '/register',
    name: 'register',
    components: {
      default:() => import('../views/register/index.vue'),
    }
  },

  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
